<template>
  <div class="app-container">
    <el-container>
      <el-header class="header" style="height: 64px">
        <ul class="header-menu menu-dake menu-hor">
          <div class="logo"></div>
          <div class="nav">
            <li class="">
              <img src="../../image/3.png" />
              <span @click="back">退出</span>
            </li>
          </div>
        </ul>
      </el-header>

      <el-container>
        <el-aside width="200px">
          <el-scrollbar>
            <el-menu
              default-active="/"
              class="el-menu-vertical-demo"
              :router="true"
              @open="handleOpen"
              @close="handleClose"
              style="height: 100vh"
            >
              <!-- 桌面页码 -->
              <el-menu-item index="/">
                <i class="el-icon-s-platform"></i>
                <span slot="title">桌面</span>
              </el-menu-item>

              <!-- 视频管理 -->
              <el-submenu index="1">
                <template slot="title">
                  <i class="el-icon-video-camera"></i>视频管理</template
                >
                <el-menu-item-group>
                  <el-menu-item index="/video">视频管理</el-menu-item>
                </el-menu-item-group>
              </el-submenu>
              <!-- 成员管理 -->
              <el-submenu index="2">
                <template slot="title">
                  <i class="el-icon-video-camera"></i>成员管理</template
                >
                <el-menu-item-group>
                  <el-menu-item index="/wish">志愿者管理</el-menu-item>
                  <el-menu-item index="/hello">志愿者审核</el-menu-item>
                  <el-menu-item index="/register">志愿者管理</el-menu-item>
                </el-menu-item-group>
              </el-submenu>

              <!-- 系统管理 -->
              <el-submenu index="3">
                <template slot="title">
                  <i class="el-icon-video-camera"></i>系统管理</template
                >
                <el-menu-item-group>
                  <el-menu-item index="/one">系统公告</el-menu-item>
                  <el-menu-item index="/two">访问统计</el-menu-item>
                  <el-menu-item index="/three">系统设置</el-menu-item>
                </el-menu-item-group>
              </el-submenu>
              
            </el-menu>
          </el-scrollbar>
        </el-aside>

        <el-container>
          <el-main>
            <router-view></router-view>
          </el-main>
          <!-- <el-footer>Footer</el-footer> -->
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  name: "LayoutView",
  data() {
    return {
      userInfo: {},
    };
  },
  created() {
    this.getUserInfo();
  },
  methods: {
    getUserInfo() {
      this.userInfo = JSON.parse(localStorage.getItem("userInfo"));
    },
    handleOpen() {},
    handleClose() {},
    back() {
      localStorage.removeItem("token-sqf");
      window.open("/login", "_self");
    },
  },
};
</script>

<style lang="scss" scoped>
.header {
  width: 100%;
  background-color: #515a6e;
  border-radius: 1px;
}
.header-menu {
  display: block;
  margin: 0;
  padding: 0;
  outline: 0;
  list-style: none;
  color: #515a6e;
  font-size: 14px;
  position: relative;
  z-index: 900;
}

.menu-dake {
  background: #515a6e;
}
.menu-hor {
  height: 60px;
  line-height: 60px;
}
.logo {
  width: 150px;
  height: 45px;
  border-radius: 3px;
  float: left;
  position: relative;
  top: 10px;
  left: 0px;
  background-image: url("../../image/2.png");
  background-size: 100% 100%;
}
.nav {
  width: 100px;
  margin: 0 auto;
  right: 30px;
  position: absolute;
}
.nav img {
  vertical-align: middle;
}
.nav span {
  color: #fff;
  margin-left: 5px;
}
</style>